home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-04 | 2.0 KB | 90 lines | [TEXT/MMCC] |
- //
- // CTCPAsyncCall.h
- //
- // TurboTCP library
- // TCP asynchronous call class
- //
- // Copyright © 1993-95, FrostByte Design / Eric Scouten
- //
-
- #pragma once
-
- #include "TurboTCP.buildflags.h"
- #include "TurboTCP.types.h"
- #include "CTCPDriver.h"
-
- #if TurboTCP_UH2
- #include <MacTCP.h>
- #else
- #include <TCPPB.h>
- #endif
-
- #if TurboTCP_PPC
- #pragma options align=mac68k
- #endif
-
- class CTCPStream;
-
-
- //***********************************************************
-
- class CTCPAsyncCall {
-
- // This object encapsulates each asynchronous call to MacTCP. This method is used so that
- // the call’s I/O block may persist beyond the scope of the method call which originates the
- // call (these methods are located in CTCPStream).
- //
- // NOTE: All interaction with CTCPAsyncCalls should be through CTCPStream. No other class
- // should have a reason to use this object, nor should this object be subclassed. Accordingly,
- // all members of this class are declared private.
-
-
- friend class CTCPStream;
- friend class CTCPDriver;
-
-
- private:
- CTCPAsyncCall(CTCPStream& theStream)
- : itsStream(theStream), itsStreamEntry(this)
- {
- itsiopb.itsQElem.qType = asyncCall;
- itsiopb.itsQElem.qSelfLink = this;
- }
-
- // initiate, process TCP call
-
- OSErr DoAsyncCall(short theCsCode, TCPiopb* theParamBlockPtr);
- OSErr DoAsyncCall(short theCsCode);
-
- void ProcessCompletion();
- Boolean Dispatch();
- Boolean DispatchNoCopyRcv();
-
- // completion procedure
-
- static void GetCompletionProc();
-
- #if TurboTCP_68K
- static pascal void CompletionProc();
- #else
- static pascal void CompletionProc(struct TurboTCPiopb* iopb);
- #endif
-
-
- // data members
-
- CTCPStream& itsStream; // the stream that requested this call
- TurboTCPiopb itsiopb; // the TCP parm block, plus a few things (see “TCPCompletionProc.h”)
- TurboTCPQElem itsStreamEntry; // entry in stream object’s call list
-
- #if TurboTCP_CFM
- static UniversalProcPtr completionProcUPP; // UPP for asynchronous completion proc
- #endif
-
- };
-
-
- #if TurboTCP_PPC
- #pragma options align=reset
- #endif
-